/*----------------------------------------------------------------------
  - File name      : STC8Ax_I2C.h
  - Author         : Quark Team
  - Update date    : 2020-12-09                   
  -	Copyright      : Gevico Electronic studio   
  - Module comments: Header file of I2C module.
-----------------------------------------------------------------------*/
#ifndef __STC8Ax_I2C_H_
#define __STC8Ax_I2C_H_
/*-----------------------------------------------------------------------
|                               INCLUDES                                |
-----------------------------------------------------------------------*/
/*--------------------------------------------------------
| @Description: STC8Ax Options                           |
--------------------------------------------------------*/
#include "STC8Ax_REG.h"   
/*--------------------------------------------------------
| @Description: STC8Ax core                              |
--------------------------------------------------------*/
#include "STC8Ax_CORE.h"
/*-----------------------------------------------------------------------
|                                 DATA                                  |
-----------------------------------------------------------------------*/
/*--------------------------------------------------------
| @Description: I2C type control enum                    |
--------------------------------------------------------*/

typedef enum
{
  I2C_Type_Master = 0x01,
  I2C_Type_Slave  = 0x00
} I2CType_Type;

/*-----------------------------------------------------------------------
|                             API FUNCTION                              |
-----------------------------------------------------------------------*/

/*--------------------------------------------------------
| @Description: I2C init function                        |
--------------------------------------------------------*/

FSCSTATE I2C_Init(I2CType_Type Type, uint8 WTime, FUNSTATE State);

/*--------------------------------------------------------
| @Description: I2C working control function             |
--------------------------------------------------------*/

FSCSTATE I2C_Start(void);
FSCSTATE I2C_Stop(void);
FSCSTATE I2C_Send_ACK(void);
FSCSTATE I2C_Send_NAK(void);
FSCSTATE I2C_Read_ACK(void);
FSCSTATE I2C_Send_Data(uint8 Dat);


#endif
/*-----------------------------------------------------------------------
|          END OF FLIE        (C) COPYRIGHT Gevico Electronics          | 
-----------------------------------------------------------------------*/

